package cn.jilian.meta.handler.domain;

import java.util.Collection;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(value=JsonInclude.Include.NON_EMPTY)
public class XField {
	
	public static final String VALIDATE_LENGTH="length";
	
	public static final String VALIDATE_INCLUSION="inclusion";
	
	public static final String VALIDATE_EXCLUSION="exclusion";
	
	public static final String VALIDATE_FORMAT="format";

	private String name;
	
	private String type;
	
	private Function calculate;
	
	private Object defaultValue;
	
	private Collection<String> depends;
	
	private Boolean persist;
	
	private Boolean unique;
	
	public XField() {
		
	}
	
	public XField(String name,String type) {
		this.name=name;
		this.type=type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Function getCalculate() {
		return calculate;
	}

	public void setCalculate(Function calculate) {
		this.calculate = calculate;
	}

	public Object getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(Object defaultValue) {
		this.defaultValue = defaultValue;
	}

	public Collection<String> getDepends() {
		return depends;
	}

	public void setDepends(Collection<String> depends) {
		this.depends = depends;
	}

	public Boolean getPersist() {
		return persist;
	}

	public void setPersist(Boolean persist) {
		this.persist = persist;
	}

	public Boolean getUnique() {
		return unique;
	}

	public void setUnique(Boolean unique) {
		this.unique = unique;
	}
	
	
}
